//
//  ASNavigationController.m
//  XiaoxiuRepair
//
//  Created by Anssy on 2019/5/29.
//  Copyright © 2019 anssy. All rights reserved.
//

#import "ASNavigationController.h"

@interface ASNavigationController ()

@end

@implementation ASNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColorWhite;
    
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(previewSetting) name:@"jumpFlexSet" object:nil];
}

- (void)willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
    [super willShowViewController:viewController animated:animated];
    BOOL isHidden = false;
    if ([viewController isKindOfClass:[ASBaseViewController class]]) {
        isHidden = ((ASBaseViewController *)viewController).isHideNavigationBar;
    }
    [self setNavigationBarHidden:isHidden animated:animated];
}



- (NSArray<UIKeyCommand *> *)keyCommands {
#ifdef DEBUG
    return @[
             // Reload
             [UIKeyCommand keyCommandWithInput:@"d"
                                 modifierFlags:UIKeyModifierCommand
                                        action:@selector(previewSetting)],
            ];
#else
    return @[];
#endif
}

- (void)previewSetting {
    [FlexSetPreviewVC presentInVC:self.visibleViewController];
}


@end
